<?php
	require_once("../../db/dbclass.php");
	require_once("../../model/userinfo.php");
	require_once("../../utils/common.php");
	$myDb=&DbController::getInstance();
	$param="SELECT user_sex FROM yj_user_info";
	$result=$myDb->exec_query($param);
	if($result==TRUE){
		/*
		json的数据格式
		{"male":"x","female":"y"}
		*/
		$male=0;
		$female=0;
		while($row=mysqli_fetch_array($result,MYSQL_ASSOC)){
			if($row['user_sex']==0){
				$male++;
			}else{
				$female++;
			}
		}
		$arr="{'male':".$male.",'female':".$female."}";
		$result=array(
			"result"=>"1",
			"data"=>$arr
			);
		echo json_encode($result);
		return;
	}
?>